<%@page import="org.sgy.mall.model.Product"%>
<%@page import="org.sgy.mall.dao.impl.ProductDaoImpl"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
</head>
<body>


	<%
	    Object listObj=request.getAttribute("list");
	    if(listObj==null){
	    	return;
	    }
	    List<Product> productList=(List<Product>) listObj;
		for (Product product : productList) {
	%>
	<form method="post" action="/edmall/CartServlet?type=add">
		<h1>产品1</h1>
		<ul>
			<li>id:<%=product.getId()%></li>
			<li>商品名称：<%=product.getName()%></li>
			<li>品牌：<%=product.getBrand()%></li>
			<li>价格:<%=product.getPrice()%></li>
		</ul>
		<input type="hidden" name="id" value=<%=product.getId()%>> <input
			type="hidden" name="name" value=<%=product.getName()%>> <input
			type="hidden" name="brand" value=<%=product.getBrand()%>> <input
			type="hidden" name="price" value=<%=product.getPrice()%>>
		购买数量:<input name="num"> <input type="submit" value="添加到购物车">
	</form>
	<%
		}
	%>

</body>
</html>
